package demo3;

// 资源类，表示系统中的资源
class Resource {
    private int[] available; // 可用资源向量

    public Resource(int n) {
        available = new int[n];
    }

    public int[] getAvailable() {
        return available;
    }

    public void setAvailable(int[] available) {
        this.available = available;
    }

    public void display() {
        System.out.print("可用资源: ");
        for (int i = 0; i < available.length; i++) {
            System.out.print(available[i] + " ");
        }
        System.out.println();
    }
}